package userService

import (
	"fmt"

	"gitee.com/little_xiang_admin/go-web-api/internal/jwtutils"
	"gitee.com/little_xiang_admin/go-web-api/models/user_info"
)

// 用户服务
type UserService struct {
	UserInfo *user_info.UserInfo
}

// 登录
func Login() {

}

func LoginOut() {

}

func (userService *UserService) Register() (string, error) {
	// 注册用户
	userName := userService.UserInfo.UserName
	userId := userService.UserInfo.UserId
	fmt.Println(userName)
	// 生成token
	token, err := jwtutils.GeneratoToken(userName, userId)
	fmt.Println(token)
	return token, err
}
